package week03.day01;

import java.util.Scanner;

public class 分支练习3 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入您的税前工资：");
        double salary = scanner.nextDouble();
        double taxableIncome = salary - 5000 - (salary * 0.1);
        double tax = 0;
        if (taxableIncome <= 0) {
            System.out.println("您无需缴纳个人所得税！");
        } else if (taxableIncome <= 3000) {
            tax = taxableIncome * 0.03;
        } else if (taxableIncome <= 12000) {
            tax = taxableIncome * 0.1;
        } else if (taxableIncome <= 25000) {
            tax = taxableIncome * 0.2;
        } else if (taxableIncome <= 35000) {
            tax = taxableIncome * 0.25;
        } else if (taxableIncome <= 55000) {
            tax = taxableIncome * 0.3;
        } else if (taxableIncome <= 80000) {
            tax = taxableIncome * 0.35;
        } else {
            tax = taxableIncome * 0.45;
        }
        double afterTaxSalary = salary - tax;
        System.out.println("您的纳税数额为：" + tax);
        System.out.println("您的税后工资为：" + afterTaxSalary);
    }
}